<?php
class ext_combo_model extends MY_Model {

	function returnres($ls_sql){
		$result	= $this->db->query($ls_sql);
		if($result->num_rows() > 0){
			return $result->result_array();
		}else{
			return array();
		}
	}

	function listBarang() {
		$ls_sql	= "	SELECT	id_barang_pk value,
							nama_barang display
					FROM	ext_barang
					ORDER BY nama_barang ";
					
		return $this->returnres($ls_sql);
	}

	function listPenawaran() {
		$ls_sql	= "	SELECT	id_penawaran_pk value,
							id_penawaran_pk display
					FROM	ext_penawaran
					ORDER BY id_penawaran_pk ";
					
		return $this->returnres($ls_sql);
	}



	function listKategori() {
		$ls_sql	= "	SELECT	id_kategori_pk value,
							nama_kategori display
					FROM	ext_kategori
					ORDER BY nama_kategori ";
					
		return $this->returnres($ls_sql);
	}

	function listKondisi() {
		$ls_sql	= "	SELECT	id_kondisi_pk value,
							nama_kondisi display
					FROM	ext_kondisi
					ORDER BY nama_kondisi ";
					
		return $this->returnres($ls_sql);
	}

	function listPembeli() {
		$ls_sql	= "	SELECT	id_pembeli_pk value,
							nama_pembeli display
					FROM	ext_pembeli
					ORDER BY nama_pembeli ";
					
		return $this->returnres($ls_sql);
	}

	function listSatuan() {
		$ls_sql	= "	SELECT	id_satuan_pk value,
							nama_satuan display
					FROM	ext_satuan
					ORDER BY nama_satuan ";
					
		return $this->returnres($ls_sql);
	}

	function listStatusPenawaran() {
		$ls_sql	= "	SELECT	id_status_penawaran_pk value,
							nama_status_penawaran display
					FROM	ext_status_penawaran
					ORDER BY nama_status_penawaran ";
					
		return $this->returnres($ls_sql);
	}

	function listVendor() {
		$ls_sql	= "	SELECT	id_vendor_pk value,
							nama_vendor display
					FROM	ext_vendor
					ORDER BY nama_vendor ";
					
		return $this->returnres($ls_sql);
	}
}